package me.dengfengdecao.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

/**
 * 如果想要自己完全控制WebMVC，就需要在@Configuration注解的配置类上增加@EnableWebMvc
 * @ SpringBootApplication 注解的程序入口类已经包含@Configuration），增加该注解以后WebMvcAutoConfiguration中配置就不会生效，
 * 你需要自己来配置需要的每一项。这种情况下的配置还是要多看一下WebMvcAutoConfiguration类
 * <br/>
 * Spring Boot默认会扫描启动类同包以及子包下的注解
 * <br/>
 * Created by dengfengdecao on 16/9/25.
 */
@SpringBootApplication
public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(Application.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
